fix: replace unhandled throw with logger.e in FAQ screen launchUrl#3385
Merged
marcnause merged 1 commit intoJul 1, 2026
Merged
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces an unhandled thrown string in the FAQ screen URL launcher with structured logging, preventing crashes when URL launch fails and aligning with existing logger usage patterns. Sequence diagram for updated FAQ URL launch behaviorsequenceDiagram
actor User
participant FAQScreen
participant _launchURL
participant canLaunchUrl
participant launchUrl
participant logger
User ->> FAQScreen: onTap
FAQScreen ->> _launchURL: _launchURL(faq.linkUrl)
_launchURL ->> canLaunchUrl: canLaunchUrl(uri)
canLaunchUrl -->> _launchURL: bool
alt [canLaunchUrl returns true]
_launchURL ->> launchUrl: launchUrl(uri)
else [canLaunchUrl returns false]
_launchURL ->> logger: e(appLocalizations.launchError + url)
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider providing some lightweight user feedback (e.g., a SnackBar or dialog) when
canLaunchUrlreturns false so failures aren’t completely silent and users know the tap didn’t succeed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider providing some lightweight user feedback (e.g., a SnackBar or dialog) when `canLaunchUrl` returns false so failures aren’t completely silent and users know the tap didn’t succeed.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
rahul31124
approved these changes
Jul 1, 2026
_launchURL() in faq_screen.dart threw a raw string when canLaunchUrl returned false. This throw was never caught at the call site (onTap: () => _launchURL(faq.linkUrl!)), so it propagated up and crashed the app instead of failing gracefully. Replaced the throw with logger.e(), consistent with how launchUrl failures are already handled in about_us_screen.dart. Fixes fossasia#3384
9b25546 to
cd1750f
Compare
marcnause
approved these changes
Jul 1, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3384
Problem
_launchURL()inlib/view/faq_screen.dartthrows a raw string exception whencanLaunchUrlreturns false. The only call site is a fire-and-forgetonTaphandler with notry/catch, so the exception is never caught and crashes the app.Root Cause
The call site:
Fix
Replaced the
throwwithlogger.e(), matching the pattern already used inabout_us_screen.dartfor the same kind of failure:Impact
Screenshots / Recordings
N/A — crash fix, no UI changes
Checklist
constants.dartor localization files instead of hard-coded values.dart formator the IDE formatter.flutter analyzeand tests run influtter test.Summary by Sourcery
Bug Fixes: